#pragma once
#include "cpplib.h"

constexpr auto LUA_MULTRET = -1;
using LuaLLoadbuffer = int (*)(uintptr lptr, const char*, int, const char*);
// int luaB_loadstring(lua_State* L)
using LuaBLoadstring = int (*)(uintptr lptr);
// 00007FF793E999B0 LuaB_loadstring
using LuaPcall = int (*)(uintptr lptr, int nargs, int nresults, int errfunc);
using LuaLRegister = void (*)(uintptr lptr, const char* libname, uintptr table);
using LuaSettop = void (*)(uintptr lptr, int index);
using LuaGettop = int (*)(uintptr lptr);
using LuaTonumber = double (*)(uintptr, int index);
using LuaTointeger = int (*)(uintptr, int index);
using LuaToboolean = int (*)(uintptr, int index);
using LuaTolstring = const char* (*)(uintptr, int index, size_t* len);
using LuaPushnumber = void (*)(uintptr lptr, double n);
using LuaPushinteger = void (*)(uintptr lptr, int n);
using LuaPushboolean = void (*)(uintptr lptr, int b);
using LuaPushlstring = void (*)(uintptr lptr, const char* s, size_t l);


void bypass_lua_invoke_checking();
uintptr lptr();
int pcall(int nargs, int nresults, int errfunc);
int lua_loadstring(const char* s);
int lua_dostring(const char* luastring);
int lua_dofile(const char* filepath);
void lua_settop(int index);
int lua_gettop();
void lua_register(const char* libname, uintptr table);
double lua_tonumber(int index);
int lua_tointeger(int index);
boolean lua_toboolean(int index);
const char* lua_tostring(int index);
void lua_pushnumber(double n);
void lua_pushinteger(int n);
void lua_pushboolean(boolean b);
void lua_pushstring(const char* s);
